from applications.configs.common import AIGC_LIST
from .TaiChu import TaiChu

# AIGC 基础类
class AIGC:
    obj = None  # 驱动对象

    # 初始化参数
    def __init__(self, driver_name=False):
        """
            初始化参数
        :param driver_name:         驱动类
        """
        driver_name = driver_name if driver_name or driver_name in AIGC_LIST else "TaiChu"
        self.obj = eval(f"{driver_name}()")

    # 发送文本消息
    def send_text_message(self, questions):
        if not self.obj:
            return False, "没有该驱动"

        return self.obj.send_text_message(questions)